from pydantic import BaseModel
from datetime import datetime
from datetime import date as date_ 


# 定义请求模板
class CreateUser(BaseModel):
    username: str
    userEmail: str
    password: str
    state: bool = True
    depeID: int = 0
    roleID: int = 0
    token: str = ""

# 定义用户登录模板
class LoginUser(BaseModel):
    username: str
    password: str

# 定义相应模板
class ReadUser(CreateUser):
    userID: int
    state: bool
    depeID: int
    roleID: int
    token: str
    created_at: datetime
    updated_at: datetime

    class Config:
        orm_mode = True

# 返回给用户的token
class Token(BaseModel):
    access_token: str
    token_type: str

